package com.xoa.controller.financialManage;

import com.xoa.model.financialManage.IncomeExpenseRecordsWithBLOBs;
import com.xoa.service.financialManage.IncomeExpenseRecordsService;
import com.xoa.util.ToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

//收支记录
@RestController
@RequestMapping("/IncomeRecords")
public class IncomeExpenseRecordsController {

    @Autowired
    private IncomeExpenseRecordsService recordsService;

    //查询列表
    @RequestMapping("/findRecords")
    private ToJson findRecords(HttpServletRequest request, IncomeExpenseRecordsWithBLOBs recordsWithBLOBs){
        return recordsService.findRecords(request,recordsWithBLOBs);
    }

    //根据ID查询
    @RequestMapping("/findRecordsById")
    private ToJson findRecordsById(HttpServletRequest request, IncomeExpenseRecordsWithBLOBs recordsWithBLOBs){
        return recordsService.findRecordsById(request,recordsWithBLOBs);
    }


    //修改和新增
    @RequestMapping("/editRecords")
    private ToJson editRecords(HttpServletRequest request, IncomeExpenseRecordsWithBLOBs recordsWithBLOBs){
        return recordsService.editRecords(request,recordsWithBLOBs);
    }

    //删除
    @RequestMapping("/deleteRecords")
    private ToJson deleteRecords(HttpServletRequest request, IncomeExpenseRecordsWithBLOBs recordsWithBLOBs){
        return recordsService.deleteRecords(request,recordsWithBLOBs);
    }

    //收支记录统计图
    @RequestMapping("/findstatistics")
    private ToJson findstatistics(HttpServletRequest request, IncomeExpenseRecordsWithBLOBs recordsWithBLOBs){
        return recordsService.findstatistics(request,recordsWithBLOBs);
    }
}
